Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: QuickTime Components

Previous | Overview | Contents | Next |

Editing Movies

Movie controller components can provide editing capabilities. This section describes the functions that your application can use to alter movies that are associated with movie controllers.

Your application can use the MCEnableEditing function to enable editing for a specified movie controller. Movie controller components may return an error code indicating that editing is not supported. Use the MCIsEditingEnabled function to find out if editing is enabled for a specified controller.

The MCCopy , MCCut , MCPaste , MCClear , and MCUndo functions support normal editing operations on movies associated with movie controllers. These functions operate on the current movie selection.

Two functions are also provided that facilitate work with Edit menus. You can use the MCSetUpEditMenu function to highlight and name the items in the Edit menu for your application. The MCGetMenuString function is provided for you to use with a non-standard Edit menu.

MCEnableEditing

The MCEnableEditing function allows your application to enable and disable editing for a movie controller. Once editing is enabled for a controller, the user may edit the movie associated with the controller.

pascal ComponentResult MCEnableEditing (MovieController mc,
                                          Boolean enabled);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function (described on NewMovieController ).

enabled
Specifies whether to enable or disable editing for the controller. Set this parameter to true to enable editing; set the enabled parameter to false to disable editing.

DESCRIPTION

By default, editing is turned off when you create a new movie controller. If you want to allow the user to edit, you must use the MCEnableEditing function to enable editing.

SPECIAL CONSIDERATIONS

Note that a movie controller component may not support editing. Therefore, your application should check the component result from this function before continuing with other movie-editing operations.

MCIsEditingEnabled

The MCIsEditingEnabled function allows your application to determine whether editing is currently enabled for a movie controller. The movie controller component returns a long value reflecting the edit state of the controller. Once editing is enabled for a controller, the user may edit the movie associated with the controller.

pascal long MCIsEditingEnabled (MovieController mc);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function (described on NewMovieController ).

DESCRIPTION

The MCIsEditingEnabled function returns a long integer that contains a value indicating the current edit state of the controller. This returned value is set to 1 if editing is enabled. This returned value is set to 0 if editing is disabled or if the controller component does not support editing.

MCCut

The MCCut function returns a copy of the current movie selection from the movie associated with a specified controller and then removes the current movie selection from the source movie. Your application is responsible for the returned movie. If you want to allow the user to paste the movie selection, use the Movie Toolbox's PutMovieOnScrap function to place the movie selection onto the scrap. Be sure to dispose of the movie afterward, using the Movie Toolbox's DisposeMovie function.

pascal Movie MCCut (MovieController mc);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function (described on NewMovieController ).

DESCRIPTION

The MCCut function returns a movie containing the current selection from the movie associated with the specified controller. If the user has not made a selection, the returned movie reference is set to nil .

SEE ALSO

The MCCut function is analogous to the Movie Toolbox's CutMovieSelection function.

MCCopy

The MCCopy function returns a copy of the current movie selection from the movie associated with a specified controller. The selection remains active after this operation. Your application is responsible for the returned movie.

If you want to allow the user to paste the movie selection, use the Movie Toolbox's PutMovieOnScrap function to place the movie selection onto the scrap. Be sure to dispose of the movie afterward, using the Movie Toolbox's DisposeMovie function.

pascal Movie MCCopy (MovieController mc);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function (described on NewMovieController ).

DESCRIPTION

The MCCopy function returns a movie containing the current selection from the movie associated with the specified controller. If the user has not made a selection, the returned movie reference is set to nil .

SEE ALSO

This function is analogous to the Movie Toolbox's CopyMovieSelection function.

MCPaste

The MCPaste function inserts a specified movie at the current movie time in the movie associated with a specified controller.

pascal ComponentResult MCPaste (MovieController mc,
                                         Movie srcMovie);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function (described on NewMovieController ).

srcMovie
Specifies the movie to be inserted into the current selection in the movie associated with the movie controller specified by the mc parameter. If you set this parameter to nil , the movie controller component retrieves the source movie from the scrap.

DESCRIPTION

All of the tracks from the source movie are placed in the destination movie. If the duration of the destination movie's current selection is 0, the source movie is inserted at the starting time of the current selection. If the current selection duration is nonzero, the function clears the current selection and then inserts the tracks from the source movie. After the paste operation, the current selection time is set to the start of the tracks that were inserted and the duration is set to the source movie's duration.

SEE ALSO

This function is analogous to the Movie Toolbox's PasteMovieSelection function.

SPECIAL CONSIDERATIONS

The preferred way to use the MCPaste function is to set the srcMovie parameter to nil . This causes the movie controller to use movie import components to paste other types of data than movies.

MCClear

The MCClear function removes the current movie selection from the movie associated with a specified controller.

pascal ComponentResult MCClear (MovieController mc);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function.

DESCRIPTION

After removing the segment, the duration of the movie's current selection is set to 0. This function removes empty tracks from the resulting movie.

SEE ALSO

This function is analogous to the Movie Toolbox's ClearMovieSelection function.

MCUndo

The MCUndo function allows your application to discard the effects of the most recent edit operation.

pascal ComponentResult MCUndo (MovieController mc);
mc
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function (described on NewMovieController ).

SEE ALSO

Your movie controller component could use the Movie Toolbox's edit state functions to implement this function. (See the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for more information about the edit state functions.)

MCSetUpEditMenu

The MCSetUpEditMenu function correctly highlights and names the items in your application's Edit menu.

pascal ComponentResult MCSetUpEditMenu (MovieController mc,
                                         long modifiers,
                                         MenuHandle mh);
mc
Specifies the movie controller for this operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function.

modifiers
Indicates the current modifiers from the mouse-down or key-down event to which you are responding.

mh
Specifies a menu handler to your current Edit menu. The first six items in your Edit menu should be the standard editing commands: Undo, a blank line, Cut, Copy, Paste, and Clear.

DESCRIPTION

When your application is highlighting its menus, you should call MCSetUpEditMenu immediately before you use the Menu Manager's MenuSelect or MenuKey functions. For details on MenuSelect and MenuKey , see Inside Macintosh: Macintosh Toolbox Essentials .

MCGetMenuString

If your application has a non-standard Edit menu, you can use the MCGetMenuString function together with the MCGetControllerInfo function to assign names correctly to the items in your application's Edit menu.

pascal ComponentResult MCGetMenuString (MovieController mc,
                                         long modifiers,
                                         short item,
                                         Str255 aString);
mc
Specifies the movie controller for this operation. You obtain this identifier from the Component Manager's OpenComponent or OpenDefaultComponent function, or from the NewMovieController function.

modifiers
Indicates the current modifiers from the mouse-down or key-down event to which you are responding.

item
Contains one of the appropriate movie controller Edit menu constants returned in the aString parameter.

aString
Contains (on return) an appropriate string to set the menu item text. The following flags are available:

mcMenuUndo
Contains the string to set the menu item text to the Undo command.

mcMenuCut
Contains the string to set the menu item text to the Cut command.

mcMenuCopy
Contains the string to set the menu item text to the Copy command.

mcMenuPaste
Contains the string to set the menu item text to the Paste command.

mcMenuClear
Contains the string to set the menu item text to the Clear command.

DESCRIPTION

The MCGetMenuString function is used by the MCSetUpEditMenu function, which is described in the previous section.

SEE ALSO

To highlight menu items, use the MCGetControllerInfo function, which is described on MCGetControllerInfo , to determine which items should be enabled.


© 1999 Apple Computer, Inc.

Previous | Overview | Contents | Next